package com.yanqu.road.server.cmd.activity.snowgarden;

import com.yanqu.road.entity.activity.snowgarden.config.SnowGardenConfig;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SnowGardenProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.snowgarden.SnowGardenModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.snowgarden.SnowGardenMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = GameProtocol.S_SNOW_GARDEN_CROSS_VISIT_RETURN, desc = "跨服拜访返回")
public class SnowGardenCrossVisitBackCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        SnowGardenProto.CrossVisitOtherSnowGardenRespMsg respMsg = SnowGardenProto.CrossVisitOtherSnowGardenRespMsg.parseFrom(packet.getBytes());
        player.sendPacket(ClientProtocol.U_SNOW_GARDEN_VISITOR_OTHER, respMsg.getRespMsg().toBuilder());
        if (respMsg.getRecordTime() > 0) {
            player.getModule(SnowGardenModule.class).updateVisitRecordCrossBack(respMsg.getTargetUserId(), respMsg.getRecordTime());
        }
    }

    @Override
    public void sendData(GamePlayer player) {
    }
}
